<template>
	<div>
		<el-tabs type="border-card" v-model="activeName" @tab-click="handleTabClick">
      <el-tab-pane label="自定义菜单" name="first"><define-menu></define-menu></el-tab-pane>
			<el-tab-pane label="一级二级首页轮播图设置" name="second"><swiper-setting></swiper-setting></el-tab-pane>
      <el-tab-pane v-if="mbId == 'mb5'" label="首页导航栏" name="third"><define-nav></define-nav></el-tab-pane>
      <el-tab-pane label="开屏广告" name="fourth"><start-adv></start-adv></el-tab-pane>
			<el-tab-pane label="升级会员设置" name="fifth"><upgradeVip></upgradeVip></el-tab-pane>
			<el-tab-pane label="友商链接" name="sixed"><friendLink></friendLink></el-tab-pane>
      <el-tab-pane label="我要推广" name="seventh"><spread></spread></el-tab-pane>
      <el-tab-pane label="首页标题自定义" name="eight"><setTitle></setTitle></el-tab-pane>
      <el-tab-pane label="底部导航设置" name="nine"><setNav></setNav></el-tab-pane>
			<!-- <el-tab-pane label="成为代理编辑"><becomeAgent></becomeAgent></el-tab-pane> -->
			<!-- <el-tab-pane label="会员权益编辑"><vipBenefit></vipBenefit></el-tab-pane> -->
		</el-tabs>
	</div>
</template>
<script>
// import swiperSetting form './tabs/swiper.vue'
import { getThemeId } from '@/utils/permission'
export default {
  components: {
    defineMenu: require('../menu/index.vue').default, // 自定义菜单
    swiperSetting: require('./tabs/swiper.vue').default,
    defineNav: require('../nav/index.vue').default, // 自定义导航栏
    startAdv: require('./tabs/startAdv.vue').default, // 开屏广告
    upgradeVip: require('./tabs/upgradeVip.vue').default,
    friendLink: require('./tabs/friendLink.vue').default,
    spread: require('./tabs/spread.vue').default, // 我要推广
    setTitle: require('./tabs/setTitle.vue').default, // 自定义标题
    setNav: require('./tabs/setNav.vue').default // 自定义标题
    // becomeAgent: require('./tabs/becomeAgent.vue').default,
    // vipBenefit: require('./tabs/vipBenefit.vue').default
  },
  data() {
    return {
      activeName: 'first',
      mbId:'',
    }
  },
  mounted() {
    this.mbId = getThemeId()
    const activeName = this.$route.params.activeName
    if (activeName) {
      this.activeName = activeName
    }
    if(this.activeName == 'third') {
      console.log('mounted')
    }
  },
  methods: {
    handleTabClick() {
      localStorage.setItem('manageBar', this.activeName)
      if(this.activeName == 'third') {
        this.versions()
      }
    },
    versions() {
      var u = navigator.userAgent
      console.log('版本', u)
      if(u.indexOf('AppleWebKit') == -1 && u.indexOf('Trident') == -1 && u.indexOf('Presto') == -1){
        //苹果、谷歌内核 //opera内核//IE内核
        // this.$message({
        //   type: 'warning',
        //   message: '此浏览器不支持，请您更换为谷歌或者360浏览器'
        // })
        this.$confirm('此浏览器不支持自定义导航栏，请您更换为谷歌或者360浏览器', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        })
      }
    }
  }
}
</script>
<style scoped>

</style>
